﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HFK.DxFluentUI.Utility
{
  //http://www.codeproject.com/KB/linq/LINQGroupByMultipleColumn.aspx
  public class EnumerableSource<T> : IEnumerable, IEnumerable<T>
  {
    IEnumerable data;

    public EnumerableSource(IEnumerable items)
    {
      data = items;
    }

    IEnumerator<T> IEnumerable<T>.GetEnumerator()
    {
      foreach (T item in data)
      {
        yield return item;
      }
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
      IEnumerable<T> iEnumerable = this;
      return iEnumerable.GetEnumerator();
    }
  }
}
